package com.wangnan.springbootstudy.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.annotation.Retention;

@Target({ElementType.FIELD,ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface MyAnnotation {
    String name() default "lisi";
}

class Test{
    @MyAnnotation(name = "zhangsan")
    String name;

    @MyAnnotation
    public void add(){}
}